package com.zmn.oms.zmn.business.interfaces.ins;

import com.zmn.oms.model.entity.ins.InsOrder;
import com.zmn.oms.model.entity.ins.InsOrderMaster;
import com.zmn.oms.model.entity.ins.InsOrderMasterQuery;
import com.zmn.oms.model.entity.ins.InsOrderMasterSync;

import java.util.List;

/**
 * 类描述：师傅按单保险业务Service
 *
 * @author lhl
 * @date 2020/06/01 19:34
 */
public interface InsOrderBService {

    /**
     * 订单ID查询参保订单
     * @param orderId
     * @return
     */
    InsOrder findInsOrderByOrderId(Long orderId);

    /**
     * 订单ID查询参保订单
     * @param orderIds
     * @return
     */
    List<InsOrder> listInsOrderByOrderIds(List<Long> orderIds);

    /**
     * 查村订单参保师傅
     * @param insOrderMasterQuery
     * @return
     */
    List<InsOrderMaster> listInsOrderMasters(InsOrderMasterQuery insOrderMasterQuery);

    /**
     * 更新参保订单信息和参保师傅信息
     * @param updateInsOrder
     * @param addInsOrderMasters
     * @param delInsOrderMasters
     */
    void updateInsOrderAndMasters(InsOrder updateInsOrder, List<InsOrderMaster> addInsOrderMasters,
                                  List<InsOrderMaster> delInsOrderMasters);

    /**
     * 结束按单保险订单
     * @param insOrder
     */
    void endInsOrderAndMasters(InsOrder insOrder, List<InsOrderMaster> delInsOrderMasters,
                               InsOrderMasterSync insOrderMasterSync);

    /**
     * 新增按单保险订单
     * @param insOrder
     */
    void saveInsOrder(InsOrder insOrder, List<InsOrderMaster> insOrderMasters);
}
